package com.ebupt.migu.ksms.service;

import com.ebupt.migu.common.push.PushRequestBody;
import com.ebupt.migu.common.push.PushTopicBean;
import com.ebupt.migu.common.sms.CallerHungUpMessageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

/**
 * @author liuyangyang@e-byte.com
 * @description: TODO
 * @date 2024/8/15 15:40
 */
@Service
public class SMSProducerService {

    private final KafkaTemplate<String, CallerHungUpMessageBean> kafkaTemplate;

    @Autowired
    public SMSProducerService(KafkaTemplate<String, CallerHungUpMessageBean> kafkaTemplate) {
        this.kafkaTemplate = kafkaTemplate;
    }

    public void sendMessage(CallerHungUpMessageBean bean) {
        kafkaTemplate.send("RFMENT-CALLER-HUNG-UP-MESSAGE-TOPIC", bean);
    }
}
